package com.ytkj.digitalConstruction.dao.constructionprocess;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.ytkj.digitalConstruction.entity.constructionprocess.ConstructionBase;
import com.ytkj.digitalConstruction.httpbean.constructionprocess.reqbean.HistoryQueryBean;
import com.ytkj.digitalConstruction.httpbean.constructionprocess.resbean.FlowBaseInfo;
import com.ytkj.digitalConstruction.httpbean.constructionprocess.resbean.FlowInProCount;
import com.ytkj.digitalConstruction.httpbean.constructionprocess.resbean.WholeFlowInfo;

/**
 * 不停航施工Mapper
 * @author iking
 *
 */
@Mapper
public interface ConstructionBaseMapper {
    int deleteByPrimaryKey(Integer flowId);

    int insert(ConstructionBase record);

    int insertSelective(ConstructionBase record);

    ConstructionBase selectByPrimaryKey(Integer flowId);

    int updateByPrimaryKeySelective(ConstructionBase record);

    int updateByPrimaryKey(ConstructionBase record);
    
    /**
     * @Title: selectFlowInProByFlowId 
     * @Description: 根据项目子流程ID查询流程及项目信息
     * @param @param flowId
     * @param @return 
     * @return FlowBaseInfo
     * @throws
     */
    FlowBaseInfo selectFlowInProByFlowId(int flowId);
    
    /**
     * @Title: countFlowByProId 
     * @Description: 根据项目编号查询对应流程数量与项目名称
     * @param @param projectId 项目编号
     * @param @return 
     * @return FlowInProCount
     * @throws
     */
    FlowInProCount countFlowByProId(int projectId);
    
    /**
     * @Description: 根据flowId查询整个流程信息
     * @Title: showWholeFlowByFlowId 
     * @param @param flowId
     * @param @return 
     * @return WholeFlowInfo
     * @throws
     */
    WholeFlowInfo showWholeFlowByFlowId(Integer flowId);
    
    /**
     * @Description: 根据projectId查询整个流程信息，创建时间降序排列
     * @Title: showWholeFlowByProjectId 
     * @param @param projectId
     * @param @return    设定文件 
     * @return List<WholeFlowInfo>    返回类型 
     * @throws
     */
    List<FlowBaseInfo> showWholeFlowByProjectId(Integer projectId);
    
    /**
     * @Description: 只负责更新进度
     * @Title: updateSpecialById 
     * @param @param flowId
     * @param @param specialProcessId
     * @param @return 
     * @return int
     * @throws
     */
    int updateSpecialById(@Param("flowId") Integer flowId, @Param("specialProcessId") String specialProcessId); 
    
    /**
     * @Description: 验证多个项目中是否有未完成的项目
     * @Title: checkIsFinish 
     * @param @param projectIds
     * @param @return    设定文件 
     * @return int    返回类型 
     * @throws
     */
    int checkIsFinish(String projectIds);
    
    /**
     * @Description: 验证流程编号是否重复
     * @Title: checkFlowNumberRepeat 
     * @param @param flowNumber
     * @param @return    设定文件 
     * @return int    返回类型 
     * @throws
     */
    int checkFlowNumberRepeat(String flowNumber);
    
    /**
     * @Description: 根据项目ID展示今日流程
     * @Title: showToday 
     * @param @param projectId
     * @param @return    设定文件 
     * @return ConstructionBase    返回类型 
     * @throws
     */
    ConstructionBase showToday(Integer projectId);
    
    /**
     * @Description: 根据项目ID展示历史流程
     * @Title: showHistory 
     * @param @param projectId
     * @param @return    设定文件 
     * @return ConstructionBase    返回类型 
     * @throws
     */
    List<ConstructionBase> showHistory(HistoryQueryBean historyQueryBean);
}